#include<iostream>
#include<cstring>
using namespace std;
int main()
{
	int n, G, P;
	while(cin >> n)
	{
		for(int I = 1; I <= n; I++)
		{
			cin >> G >> P;
			cout << "Team #" << I << endl;
			cout << "Games: " << G << endl;
			cout << "Points: " << P << endl;
			cout << "Possible records:" << endl;
//			for(int i = P / 3; i >= 0; i--)
			for(int i = P; i >= 0; i--)
			{
				for(int j = 0; j <= P; j++)
				{
					for(int k = 0; k <= P; k++)
					{
						if(i + j + k == G)
						{
							if(3 * i + j == P)
							{
								cout << i << "-" << j << "-" << k << endl;
							}
						}
					}
				}
			}
			if(I < n) cout << endl;
		}
	}
	return 0;
}

/*
Team #1 
Games: 6 
Points: 10 
Possible records:
3-1-2 
2-4-0 

Team #2 
Games: 1 
Points: 3 
Possible records: 
1-0-0 

Team #3 
Games: 4 
Points: 4 
Possible records: 
1-1-2 
0-4-0 
*/
